package com.lm56.common.validation.anotation.constraints;

import com.lm56.common.validation.anotation.validator.MyDateTimeValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Created by Kelvin Yeung on 2016/10/30.
 */

@Target({ANNOTATION_TYPE,METHOD, FIELD, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Constraint(validatedBy = MyDateTimeValidator.class)
public @interface MyDateTimeValid {
    String pattern() default "yyyy-MM-dd HH:mm";
    String message() default  "{constraint.datetime.invalid}";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};

}
